#ifndef __TOYM__NET__POLLERS__IPOLLER_H__
#define __TOYM__NET__POLLERS__IPOLLER_H__

#include "Base/noncopyable.h"
#include <vector>

namespace toym
{
namespace net
{

class Channel;

class IPoller: noncopyable {
public:

    //// virtual functions

    virtual int poll() = 0;
    virtual void updateChannel(Channel& channel) = 0;
    virtual void removeChannel(Channel& channel) = 0;
    virtual std::vector<Channel*> getActiveChannels(int nActive) = 0;
    
    // common functions

    void handleEvents(std::vector<Channel*>& activeChannels);

    static int intervalMicroseconds;
};

} // namespace net

} // namespace toym



#endif //__TOYM__NET__POLLERS__IPOLLER_H__